Fix color linting script for cross platform development#7776
Open
Steve-Mcl wants to merge 4 commits into
Open
Conversation
Contributor
Author
|
probe files confirm the corss-platform changes finds color lint errors. The follow commits will now remove the probes The remaining |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7776 +/- ##
=======================================
Coverage 75.38% 75.38%
=======================================
Files 428 428
Lines 22539 22539
Branches 5944 5944
=======================================
Hits 16992 16992
Misses 5547 5547
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors the
scripts/lint-colors.jsscript to remove its dependency on thegrepcommand, making it cross-platform. Additionally, the exit method was changed from a noisy throw to aprocess.exit(1)(see note below)Linting infrastructure improvements:
grepshell command inscripts/lint-colors.jswith a new cross-platformgrepLinesfunction that recursively searches files for patterns, improving compatibility and reliability. (F18d4070L4R4, [1] [2]process.exit(1)instead of throwing an error, ensuring proper exit codes in all environments.Temp Testing (will be deleted after being ran on CI:* Adds two probe files,frontend/src/__lint_probe__.scssandfrontend/src/__lint_probe__.vue, containing intentional lint violations to test the color linting script. [1] [2]* Adds a probe-only theme token tofrontend/src/ui-components/stylesheets/ff-theme-light.scssto test theme parity checks.THESE WILL BE DELETED BEFORE MERGEUPDATE: test probes removed - results can be seen here: https://github.com/FlowFuse/flowfuse/actions/runs/28938870171/job/85856315043?pr=7776
NOTE:
The script originally threw a new Error(...) when a lint fail was detected. While it does give a non-zero exit code (an uncaught exception makes node exit with 1) it also dumps a stack trace pointing at lint-colors.js:159, which reads as if the script itself crashed rather than the lint found violations. The output becomes pure noise for someone who just wants to see what they need to fix.
The usual pattern for a CLI/lint tool is a clean exit with exit code e.g.
process.exit(1)BEFORE
AFTER
Related Issue(s)
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel